package juez


class Competition {
    boolean activo
    Date inicio
    Date fin
    
    String toString(){
        "contest: ${id}"
    }
    
    static hasMany=[problems:Problem,competidores:User, clarificacion:Clarification]
    static belongsTo=User
    
    def beforeInsert={
        activo=true
    }

    static constraints = {
        activo()
        inicio(min:new Date())
        fin()
    }
}
